<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue test</title>
</head>
<body>
<div>
    <div id="container">
    </div>
    <button id="btn">改动</button>
</div>
<script type="module">
    import { reactive } from "./reactive.js";
    import { effect } from "./effect.js";

    const obj = reactive({
        name: 'avicii',
        age: 18
    })

    const testList = reactive([1,2,3,4])


    const container = document.getElementById('container')

     const render = () => {
        container.innerHTML = obj.name

     }

     effect(() => {
         render()
         testList.forEach(item => {
             console.log(item)
         })
     })


    const btn = document.getElementById("btn")
    btn.addEventListener("click", function () {
        obj.name = 'alesso'
        testList[0] = 100
    })
</script>
</body>
</html>
